package cn.bonoon.entities.plugins;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.bonoon.kernel.support.entities.AbstractPersistable;

/**
 * 个人节假日（同一天内可以有n(n>=0)条记录）
 * 
 * @author ocean~
 */
@Entity
@Table(name = "T_PERSONALHOLIDAY")
public class PersonalHolidayEntity extends AbstractPersistable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1945011112910448012L;

	@Column(name = "C_YEAR")
	private int year;

	@Column(name = "C_MONTH")
	private int month;

	@Column(name = "C_DATE")
	private int date;

	/**
	 * dates=year*10000+month*100+date
	 */
	@Column(name = "C_DATES")
	private int dates;

	/**
	 * 类型（0.请假/事假； 1.病假； 2.年假； 3.加班； 4.缺席；）
	 */
	@Column(name = "C_TYPE")
	private int type;

	/**
	 * 开始时间（0.上午； 1.下午；）
	 */
	@Column(name = "C_TIME")
	private int time;

	/**
	 * 持续时间（e.g. duration=5，表示连续5天，每天请假半天，即2.5天）
	 */
	@Column(name = "C_DURATION")
	private long duration;

	@Column(name = "C_CREATORID")
	private Long creatorId;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_CREATEAT", nullable = false)
	private Date createAt;

	@Column(name = "C_CREATORNAME")
	private String creatorName;

	@Column(name = "C_REMARK", length = 600)
	private String remark;

	// 工作流实现请假审核
	// 状态：未审核/审核通过/审核不通过
	// 审核时间
	// 审核人id/name
	// ownerId

	public int getYear() {
		return year;
	}

	public void setYear(int year) {
		this.year = year;
	}

	public int getMonth() {
		return month;
	}

	public void setMonth(int month) {
		this.month = month;
	}

	public int getDate() {
		return date;
	}

	public void setDate(int date) {
		this.date = date;
	}

	public int getDates() {
		return dates;
	}

	public void setDates(int dates) {
		this.dates = dates;
	}

	public int getTime() {
		return time;
	}

	public void setTime(int time) {
		this.time = time;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public long getDuration() {
		return duration;
	}

	public void setDuration(long duration) {
		this.duration = duration;
	}

	public Long getCreatorId() {
		return creatorId;
	}

	public void setCreatorId(Long creatorId) {
		this.creatorId = creatorId;
	}

	public Date getCreateAt() {
		return createAt;
	}

	public void setCreateAt(Date createAt) {
		this.createAt = createAt;
	}

	public String getCreatorName() {
		return creatorName;
	}

	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

}
